package com.su.lightthings.adapter

import android.content.Context
import android.view.ViewGroup
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.QuickViewHolder
import com.su.lightthings.R
import com.su.lightthings.bean.WatchFunctionBean

class WatchFunctionAdapter : BaseQuickAdapter<WatchFunctionBean, QuickViewHolder>() {
    override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: WatchFunctionBean?) {
        item!!
        holder.setImageResource(R.id.iv_icon, item.icon)
        holder.setText(R.id.tv_title, item.title)
    }

    override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): QuickViewHolder =
        QuickViewHolder(R.layout.adapter_watch_function, parent)
}